<template>
  <div class="layout">
    <ParticlesBackground />
    <nav class="navbar">
      <div class="nav-inner">
        <RouterLink class="brand" to="/">
          <i class="fas fa-microchip"></i>
          有追求的开发者
        </RouterLink>
        <div class="links">
          <RouterLink to="/">首页</RouterLink>
          <RouterLink to="/blog">博客</RouterLink>
          <RouterLink to="/tools">工具</RouterLink>
          <RouterLink to="/projects">我的作品</RouterLink>
          <RouterLink to="/about">关于我</RouterLink>
        </div>
      </div>
    </nav>
    <main class="page">
      <router-view />
    </main>
    <TechFooter />
  </div>
  
</template>




<script setup lang="ts">
import ParticlesBackground from '@/components/ParticlesBackground.vue';
import TechFooter from '@/components/TechFooter.vue';
</script>

<style>
:root {
  /* 科技感主题色彩 */
  --primary: #2563eb;
  --secondary: #8b5cf6;
  --dark: #0f172a;
  --darker: #020617;
  --light: #f8fafc;
  --gray: #64748b;
  --glass: rgba(248, 250, 252, 0.08);
  --glass-border: rgba(248, 250, 252, 0.12);
  
  /* 兼容原有变量 */
  --bg: var(--dark);
  --text: var(--light);
  --muted: var(--gray);
  --accent: var(--primary);
  
  /* Element Plus 暗色主题适配 */
  --el-color-primary: var(--primary);
  --el-bg-color: var(--glass);
  --el-text-color-primary: var(--light);
  --el-text-color-regular: var(--light);
  --el-text-color-secondary: var(--gray);
  --el-border-color: var(--glass-border);
  --el-fill-color-blank: var(--glass);
  --el-bg-color-overlay: var(--glass);
}
html, body, #app { height: 100%; }
body {
  margin: 0; 
  font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft Yahei", "Noto Sans SC", Arial, sans-serif;
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.tech-font {
  font-family: 'Orbitron', monospace;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--secondary); }
code { 
  background: rgba(37, 99, 235, 0.1); 
  padding: 0.2rem 0.35rem; 
  border-radius: 6px; 
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  backdrop-filter: blur(20px);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}
.nav-inner {
  max-width: 1920px; margin: 0 auto; padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { 
  font-family: 'Orbitron', monospace;
  font-weight: 700; 
  font-size: 1.2rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand i {
  color: var(--primary);
  font-size: 1.3rem;
}
.links { display: flex; gap: 1rem; }
.links a { 
  color: var(--text); 
  opacity: 0.9; 
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}
.links a:hover { 
  color: var(--primary);
  opacity: 1;
}
.links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transition: width 0.3s;
}
.links a:hover::after,
.links a.router-link-active::after {
  width: 100%;
}
.links a.router-link-active { color: var(--primary); }
.page { 
  min-height: calc(100vh - 58px);
  padding-top: 78px; /* 为固定导航栏留出空间 */
}

/* Element Plus 组件暗色主题适配 */
:deep(.el-card) {
  background: var(--glass) !important;
  border-color: var(--glass-border) !important;
  color: var(--light) !important;
}

:deep(.el-card__header) {
  background: transparent !important;
  border-color: var(--glass-border) !important;
  color: var(--light) !important;
}

:deep(.el-card__body) {
  color: var(--light) !important;
}

:deep(.el-button) {
  border-color: var(--glass-border) !important;
}

:deep(.el-button--primary) {
  background: linear-gradient(45deg, var(--primary), var(--secondary)) !important;
  border-color: transparent !important;
}

:deep(.el-select) {
  color: var(--light) !important;
}

:deep(.el-select .el-input__inner) {
  background: var(--glass) !important;
  border-color: var(--glass-border) !important;
  color: var(--light) !important;
}

:deep(.el-tag) {
  background: rgba(37, 99, 235, 0.1) !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
  color: var(--primary) !important;
}

:deep(.el-skeleton__item) {
  background: var(--glass) !important;
}

:deep(.el-link) {
  color: var(--primary) !important;
}

:deep(.el-link:hover) {
  color: var(--secondary) !important;
}
</style>

